package com.zhx.threadcoreknowledge.createthread.wrongways;

import java.util.Timer;
import java.util.TimerTask;

/**
 * @author ：zhanghaixuan
 * @date ：Created in 2019-09-17 09:00
 * 用途         ： 定时器创建线程
 */
public class DomoTimmerTask {

    public static void main(String[] args) {
        Timer timer = new Timer();

        timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName());
            }
        },1000,1000);


    }
}
